package p.rn.util;
import java.io.File;

public abstract class FileVistor {

	private File path;

	public FileVistor(String path) {
		this.path = new File(path);
	}

	public FileVistor(File path) {
		this.path = path;
	}

	public void vist() {
		vistorDirectory(path);
	}

	private void vistorDirectory(File folder) {
		for (File file : folder.listFiles()) {
			if (file.isDirectory()) {
				vistorDirectory(file);
			} else {
				vistFile(file);
			}
		}
	}

	public abstract void vistFile(File file);

}
